home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-06-18 | 2.4 KB | 73 lines | [TEXT/MPS ] |
- // volumeinfo.h
-
- #ifndef volumeinfo_h
- #define volumeinfo_h
-
- #include <files.h>
-
- #ifndef inttypes_h
- #include "inttypes.h"
- #endif
- #ifndef errorsource_h
- #include "errorsource.h"
- #endif
-
- class volumeinfo: public errorsource
- {
- private:
- HParamBlockRec pb;
- enum
- {
- hardlockbit= 0x0080,
- softlockbit= 0x8000,
- bothlockbits= 0x8080
- };
- enum
- {
- mfssignature= 0xD2D7,
- hfssignature= 0x4244
- };
- Str31 thename;
- public:
- volumeinfo() {}
- volumeinfo( const Str31& name );
- volumeinfo( int16 refnum );
- boolean nth( uint16 );
-
- const Str31& name() const { return thename; }
- int16 refnum() const { return pb.volumeParam.ioVRefNum; }
-
- long creationdate() const { return pb.volumeParam.ioVCrDate; }
- long modificationdate() const { return pb.volumeParam.ioVLsMod; }
- long backupdate() const { return pb.volumeParam.ioVBkUp; }
-
- boolean hardwarelock() const { return pb.volumeParam.ioVAtrb & hardlockbit; }
- boolean softwarelock() const { return pb.volumeParam.ioVAtrb & softlockbit; }
- boolean locked() const { return pb.volumeParam.ioVAtrb & bothlockbits; }
-
- uint16 rootfilecount() const { return pb.volumeParam.ioVNmFls; }
- uint16 filecount() const { return pb.volumeParam.ioVFilCnt; }
- uint16 directorycount() const { return pb.volumeParam.ioVDirCnt; }
-
- uint16 bitmapstart() const { return pb.volumeParam.ioVBitMap; }
- uint16 nextallocation() const { return pb.volumeParam.ioAllocPtr; }
- uint16 allocationblockcount() const { return pb.volumeParam.ioVNmAlBlks; }
- uint16 allocationblocksize() const { return pb.volumeParam.ioVAlBlkSiz; }
- uint16 clumpsize() const { return pb.volumeParam.ioVClpSiz; }
- uint16 allocationmapstart() const { return pb.volumeParam.ioAlBlSt; }
- uint16 nextfileid() const { return pb.volumeParam.ioVNxtCNID; }
- uint16 allocationblocksfree() const { return pb.volumeParam.ioVFrBlk; }
-
- uint16 signature() const { return pb.volumeParam.ioVSigWord; }
- boolean mfs() const { return signature() == mfssignature; }
- boolean hfs() const { return signature() == hfssignature; }
-
- uint16 drivenumber() const { return pb.volumeParam.ioVDrvInfo; }
- uint16 driver() const { return pb.volumeParam.ioVDRefNum; }
- uint16 filesystem() const { return pb.volumeParam.ioVFSID; }
-
- uint16 writecount() const { return pb.volumeParam.ioVWrCnt; }
- };
-
- #endif volumeinfo_h
-